<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>-报名记录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="/favicon.ico">
    <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/static/admin/css/animate.css" rel="stylesheet">
    <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/static/admin/css/student/student.css" rel="stylesheet">
    
	<style>
	   .table-hover>tbody>tr:hover{
            background-color: #eaeaea;
        }
    
	</style>

</head>

<body class="gray-bg">
   
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>资源绑定</h5>
                       
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                          
                        </div>
                        <div class="table-responsive">
                            
                                <!-- <input type="text" class="form-control input-sm m-b-xs" id="filter"
                                       placeholder="搜索表格..."> -->
                               
                                    <h4>当前资源信息</h4>
                                    <table class="table" style="background: #f3f3f3;">
                                            <thead>
                                                <tr>
                                                    <th>学生id</th>
                                                    <th>姓名</th>
                                                    <th>学生电话</th>
                                                    <th>学生地址</th>
                                                </tr>
                                            </thead>
                                        <tbody>
                                            <tr>
                                                <td>{$this_res['sid']}</td>
                                                <td>{$this_res['sname']}</td>
                                                <td>{$this_res['stel']}</td>
                                                <td>{$this_res['sadd']}</td>
                                                
                                            </tr>
                                        </tbody>
                                    </table>
                    
                               
                                <h4>系统根据姓名 “{$this_res['sname']}” 查找到的报名记录</h4>
                                <table class="table table-bordered table-hover" data-page-size="8" data-filter=#filter>
                                    <thead>
                                            <tr>
                                                <th>记录ID</th>
                                                <th>学生姓名</th>
                                                <th>学生电话</th>
                                                <th>学生地址</th>
                                                <th>咨询师</th>
                                                <th>报名费用</th>
                                                <th>课程</th>
                                                <th>发票号</th>
                                                <th>报名时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {volist name='logdata' id='vo'}
                                                <tr class="gradeU">
                                                        <td>{$vo.id}</td>
                                                        <td>{$vo.sname}</td>
                                                        <td>{$vo.stel}</td>
                                                        <td>{$vo.sadd}</td>
                                                        <td>{$vo.username}</td>
                                                        <td>{$vo.registeryfee}</td>
                                                        <td class="center">{$vo.course}</td>
                                                        <td class="center">{$vo.receipt_number}</td>
                                                        <td class="center">
                                                            {php}echo date("y-m-d",strtotime($vo['registerytime'])){/php}
                                                        </td>
                                                        <td class="center">
                                                            <a class="bind-in" href="{:url('Signing/bindenroll')}" data-id="{$vo.id}">绑定到此记录</a>
                                                        </td>
                                                </tr>
                                            {/volist}
                                        </tbody>
                                       
                                </table>
                            
                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>
    
    <!-- 全局js -->
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/static/admin/js/plugins/footable/footable.all.min.js"></script>
    <script src="/static/admin/js/content.js"></script>
    <!-- Peity -->
    <script src="/static/admin/js/plugins/peity/jquery.peity.min.js"></script>
    <!-- Switchery -->
    <script src="/static/admin/js/plugins/switchery/switchery.js"></script>
    <script src="/static/admin/layui/layui.js"></script>
    
    <script>
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            //点击提交
            $(".bind-in").click(function(){
                var bindid=$(this).attr('data-id');
                var this_resid = "{$this_resid}";
                layer.confirm('确定要绑定吗',{btn: ['确定绑定', '取消']}
                    ,function(){
                        
                        var loading = layer.load(2);
                        $.post("{:url('Signing/bindenroll')}",{bindid:bindid,this_resid:this_resid},function(msg){
                                if (msg.code==1) {
                                    layer.msg(msg.msg,{
                                        icon: 1,
                                        time: 2000 //2秒关闭（如果不配置，默认是3秒）
                                        }, function(){
                                            window.location.href="{:url('Counselors/varlist')}";
                                    });   
                                    

                                }else{
                                    layer.msg(msg.msg,{
                                        icon: 5,
                                        time: 2000 //2秒关闭（如果不配置，默认是3秒）
                                        }, function(){
                                            window.location.href="{:url('Counselors/varlist')}";
                                    });   
                                    
                                }

                                layer.close(loading);
                        })
                    }
                );

                return false;
               
            });
            

        });

      

        $(document).ready(function() {
 

        });
    </script>
</body>
</html>
